<?php
	
	
class M_download Extends CI_Model
{
	
	public function __construct()
	{
		
		
	}

	public function download_lesson_attachments($id)
	{
		$f_id = '';
		$sql = "SELECT lesson_file_id FROM lessons WHERE lesson_id = ?";
		$query = $this->db->query($sql, array($id));
		
		if($query->num_rows() > 0)
		{
			$row = $query->row();
			$f_id = $row->lesson_file_id;
		}
		
		$d_sql = "SELECT lesson_file_name FROM lesson_files WHERE lesson_file_id = ?";
		$d_query = $this->db->query($d_sql, array($f_id));
		return $d_query->num_rows() > 0 ? $d_query->row() : FALSE;
	}
}